﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entities;

namespace Logic
{
    public class GiftFactory
    {
        public static Gift CreateGift(int i, int y)
        {
            Gift gift = new Gift(); 

            if (i == 0)
            {
                ChocolateBar chocolateBar1 = new ChocolateBar();
                chocolateBar1.Type = Entities.Type.Black;
                if (y == 0)
                {
                    chocolateBar1.Name = "Милка";
                    chocolateBar1.Price = 60;
                    chocolateBar1.Weight = 110;
                }
                else if (y == 1)
                {
                    chocolateBar1.Name = "Воздушный";
                    chocolateBar1.Price = 45;
                    chocolateBar1.Weight = 100;
                }
                else if (y == 2)
                {
                    chocolateBar1.Name = "Альпен Голд";
                    chocolateBar1.Price = 38;
                    chocolateBar1.Weight = 90;
                }
                gift.AddSweet(chocolateBar1);
            }
            else if (i == 1)
            {
                Chocolate chocolate1 = new Chocolate();
                chocolate1.Condition = true;
                chocolate1.Shape = Shape.Square;
                if (y == 0)
                {
                    chocolate1.Name = "Сникерс";
                    chocolate1.Price = 35;
                    chocolate1.Size = 25;
                    chocolate1.Weight = 100;
                }
                else if (y == 1)
                {
                    chocolate1.Name = "Марс";
                    chocolate1.Price = 30;
                    chocolate1.Size = 20;
                    chocolate1.Weight = 80;
                }
                else if (y == 2)
                {
                    chocolate1.Name = "Твикс";
                    chocolate1.Price = 38;
                    chocolate1.Size = 30;
                    chocolate1.Weight = 100;
                }
                gift.AddSweet(chocolate1);
            }
            else if (i == 2)
            {
                if (y == 0)
                {
                    Sweets sw1 = new Sweets();
                    sw1.Condition = true;
                    sw1.Name = "Коровка";
                    sw1.Price = 150;
                    sw1.Shape = Shape.Square;
                    sw1.Weight = 500;
                    gift.AddSweet(sw1);
                }
                else if (y == 1)
                {
                    JellyBean jb1 = new JellyBean();
                    jb1.Condition = true;
                    jb1.Filling = Filling.Juice;
                    jb1.Name = "Жук";
                    jb1.Price = 180;
                    jb1.Shape = Shape.Round;
                    jb1.Weight = 500;
                    gift.AddSweet(jb1);
                }
                else if (y == 2)
                {
                    Lollipop lol1 = new Lollipop();
                    lol1.Color = Color.Green;
                    lol1.Condition = true;
                    lol1.Name = "Газировка";
                    lol1.Price = 120;
                    lol1.Shape = Shape.Round;
                    lol1.Weight = 500;
                    gift.AddSweet(lol1);
                }
            }     
            return gift;
        }
    }
}
